# _*_ coding : utf-8 _*_
# @Time : 2022/9/18 19:54
# @Author : Moonquake
# @File : Horse
# @Project : base.py
import socket
s = socket.socket()
host = '127.0.0.1'
port = 1292
s.bind((host,port))
s.listen(5)

while True:
    print("waiting....")
    tcp,addr = s.accept()
    print("连接成功")
    tcp.send(input('>').encode('utf-8'))# 下达命令
    data = tcp.recv(1024)
    print(data.decode('gbk'))
    print("客户端退出")